﻿package com.webbei.Backstage.action;

import java.util.HashMap;
import java.util.Map;

import com.webbei.Backstage.service.BackstateSer;
import com.webbei.HAO.service.ChSer;
import com.webbei.custom.service.CustomSer;
import com.webbei.util.VelocityUtil;

public class UpdateProduct {
	private int productId;
	private int productSize;
	private String content;//产品描述
	private String alias;//别名
	private BackstateSer bao;
	private String msg;
	private String productName;
	private ChSer ser;
	private CustomSer cs;
	public String execute(){
		System.out.println("----------------------");
		Map<String,Object> m = new HashMap<String, Object>();
		m.put("productSize", productSize);
		m.put("productDesc", content);
		m.put("alias", alias);
		m.put("productId", productId);
		m.put("productName", productName);
		int i = bao.updateProductByMap(m);
        if(i==1){
        	msg = "success";
        }else{
        	msg="fail";
        }

        VelocityUtil.productHtml(productId, ser, cs,bao);
        System.out.println("updateproduct.....");
		return "success";
	}

	public void setSer(ChSer ser) {
		this.ser = ser;
	}


	public void setCs(CustomSer cs) {
		this.cs = cs;
	}


	public int getProductId() {
		return productId;
	}
	public void setProductId(int productId) {
		this.productId = productId;
	}

	public int getProductSize() {
		return productSize;
	}
	public void setProductSize(int productSize) {
		this.productSize = productSize;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public void setBao(BackstateSer bao) {
		this.bao = bao;
	}


	public String getProductName() {
		return productName;
	}


	public void setProductName(String productName) {
		this.productName = productName;
	}


	public String getMsg() {
		return msg;
	}


	public void setMsg(String msg) {
		this.msg = msg;
	}

}
